<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/include.jsp"%>
<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/table.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/dwz/themes/default/style.css" rel="stylesheet"
	type="text/css" media="screen" />
<link href="${ctx}/dwz/themes/css/core.css" rel="stylesheet"
	type="text/css" media="screen" />
<table border="0" cellpadding="0px" cellspacing="0" width="100%">
	<tr style="background-color: white;">
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td>
			<table style="background-color: white;" width="100%" align="left">
				<tr>
				
				
					<td width="2%" ><input type="text" id="" name="" placeholder="按宿舍号查询"/>
						</td>
					<td width="3%" > <input type="text" id="" name=""  placeholder="按宿舍类别查询" />
						</td>
					
				<td width="3%"><a class="button" href="query.jsp"><span>查询</span></a></td>
				<td width="5%"><a class="button" href="query.jsp"><span>取消</span></a></td>
				<td width="25%"></td>
				
				</tr>
			</table>
		</td>
	</tr>
	<tr>
	<!-- 	<table style="background-color: white;" width="100%">
			<tr>
				<td width="38%"></td>
				<td width="5px"><a class="button" href="query.jsp"><span>查询</span></a></td>
				<td width="5px"><a class="button" href="query.jsp"><span>取消</span></a></td>
				<td width="47%"></td>
			</tr>
		</table> -->
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="table_padding">
				<tr>
					<td>
						<table align="left">
							<tr>
								<td width="50px"><a class="button" href="add.jsp"><span>添加</span></a>
								</td>
								<td width="50px"><a class="button" href="edit.jsp"><span>修改</span></a>
								</td>
								<td width="50px"><a class="button"
									href="javascript:void(0);" onclick="del()"><span>删除</span></a></td>
							</tr>
						</table>
					</td>
					<td width="25" height="26" align="right"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center">
			<table border="1" cellpadding="0" cellspacing="0" id="box_num_table2"
				class="box_num_table">
				<thead>
					<tr bgcolor="white">
						<td width="10%"><input type="checkbox" onclick="checkAll(this)" /></td>
						<td>id</td>
						<td>宿舍号</td>
						<td>宿舍类型</td>
						<td>可住人数</td>
						<td>已住学生数</td>
						<td>备注</td>
						

					</tr>
				</thead>
				<tbody>
					<tr bgcolor="white">
						<td><input class="aaa" type="checkbox" /></td>
						<td>1</td>
						<td>101</td>
						<td>女</td>
						<td>8</td>
						<td>6</td>
						<td>可再住2人</td>
						

					</tr>
					<tr bgcolor="white">
						<td><input class="aaa" type="checkbox" /></td>
						<td>2</td>
						<td>201</td>
						<td>男</td>
						<td>8</td>
						<td>8</td>
						<td>已住满</td>
						

					</tr>
				</tbody>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table border="0" cellpadding="0" cellspacing="0"
				class="table_border">
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="table_padding">
							<tr>
								<td width="8%" class="font_left">数据:120条</td>
								<td width="12" class="font_left">第</td>
								<td width="375" class="font_left"><input name="textfield2"
									type="text" size="2" maxlength="4" /> /5页</td>
								<td width="478" class="font_right"><a href="">首页</a> <a
									href="">上一页</a> <a href="">下一页</a> <a href="">末页</a> <a href="">刷新</a>
								</td>

							</tr>
						</table>
					</td>
				</tr>
			</table>

		</td>
	</tr>
</table>
<script type="text/javascript">
	var l = $("#box_num_table2 :checkbox:not(:first)");
	var ll = $("[type=checkbox] :checkbox:not(:first):checked");
	l.click(function() {

		alert(l.length)
		alert(ll.length)
		l.each(function() {
			if (!this.checked) {
				$("#box_num_table2 input[type='checkbox']:first").prop(
						'checked', false);
				return;
			}

			if (l.length == ll.length) {
				$("#box_num_table2 input[type='checkbox']:first").prop(
						'checked', true);
			}
		})

	})

	function checkAll(obj) {
		$("#box_num_table2 input[type='checkbox']").prop('checked',
				$(obj).prop('checked'));
	}
	
	function del(){
		//alert("确定要删除该记录吗？");
		
		{
var r=confirm("确定要删除该记录吗？")
if (r==true)
  {
  alert("删除成功！")
  }
/* else
  {
  document.write("您按了取消！")
  } */
}
	}

	/* $("#box_num_table2 :checkbox:not(:first)").click(function(){
	
	 $("#box_num_table2 input[type='checkbox']:first").prop('checked',false);
	 }) */
</script>
